/**
 * @Description:根据元素获取面包屑导航路径输出到指定元素
 * @param element 页面元素，#div或者.class
 */
function outPutNavigationByElement(element){
	getNodeNavigation();
	var rootMenu = window.top.$(".ks-show").find(".dd-title-nav").html();
	var currentMenu = window.localStorage?localStorage.getItem("currentNodeMenu"):Cookie.read("currentNodeMenu");
	$(element).html(rootMenu+"&nbsp;&gt;&nbsp;"+currentMenu);
}

/**
 * 根据默认元素获取面包屑路径输出
 */
function outPutNavigation(){
	getNodeNavigation();
//	var rootMenu = localStorage.getItem("currentMenu");
	var rootMenu = window.top.$(".ks-show").find(".dd-title-nav").html();
	var currentMenu = localStorage.getItem("currentNodeMenu");
	$(".cur-position").html(rootMenu+"&nbsp;&gt;&nbsp;"+currentMenu);
}

/**
 * 获取父节点选中的tabPanel菜单标题名称
 */
function getNodeNavigation(){
	var currentMenu = parent.$("#tab-menus").tabs('getSelected').panel('options').title;
	if(currentMenu==undefined)
		return;
	if (window.localStorage) {
		localStorage.setItem("currentNodeMenu", currentMenu);
	} else {
	    Cookie.write("currentNodeMenu", currentMenu);	
	}
}
$(function(){
	//输出页面面包屑导航
	outPutNavigation();
});
